﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StoreWeb.system.memberManage
{
    public partial class sizeTemplateDetail : System.Web.UI.Page
    {
        //BLL.Role role = new BLL.Role();
        BLL.sizeTemplateDetail sizetemplateDetail = new BLL.sizeTemplateDetail();
        public string sizetemplateDetailstr = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Bind();
                hidid.Value = Request.QueryString["id"];
                id.Value = hidid.Value;

                int counts = sizetemplateDetail.GetModelList(string.Format("sizeTemplateId={0}", hidid.Value)).Count;
                if (counts > 0){
                    List<Model.sizeTemplateDetail> sizeTemplateDetails = sizetemplateDetail.GetModelList(string.Format("sizeTemplateId={0}", hidid.Value));
                    for (int i = 0; i < sizeTemplateDetails.Count; i++)
                    {
                        sizetemplateDetailstr += "<tr class=\"body\">";
                        sizetemplateDetailstr += "<td><input class=\"name\" type=\"text\" value=\"" + sizeTemplateDetails[i].name + "\"   name=\"name\"></td>";
                        sizetemplateDetailstr += "<td>";
                        sizetemplateDetailstr += "<span class=\"button minus\"></span>";
                        sizetemplateDetailstr += "<input class=\"number\" type=\"text\" value=\"" + sizeTemplateDetails[i].value + "\"    name=\"value\">";
                        sizetemplateDetailstr += "<span class=\"button plus\"></span>";
                        sizetemplateDetailstr += "</td>";
                        sizetemplateDetailstr += "<td><a class=\"del\" href=\"javascript:;\">删除</a></td>";
                        sizetemplateDetailstr += "</tr>";
                    }
                }
                else {
                    sizetemplateDetailstr = "";
                }


            }
        }

        //private void Bind()
        //{
        //    BLL.memberGrade message = new BLL.memberGrade();
        //    //加载等级
        //    ddlmemberGrade.DataSource = message.GetList(" ");
        //    ddlmemberGrade.DataTextField = "grade";
        //    ddlmemberGrade.DataValueField = "grade";
        //    ddlmemberGrade.DataBind();
        //    ddlmemberGrade.Items.Insert(0, new ListItem { Value = "0", Text = "------请分配等级------" });

        //}
    }
}